/*
 * Tracker.cpp
 *
 *  Created on: Dec 29, 2014
 *      Author: wasp
 */

#include "src/tracking/Tracker.hpp"
#include "src/location/Route.hpp"
#include <qdatetime.h>
#include <qdebug.h>

namespace de
{
namespace heimweghelden
{
namespace tracking
{
    Tracker::Tracker(QObject* parent): QObject(parent)
    {
        estimatedTime = -1;
        latStart = 0;
        lonStart = 0;
        latDest = 0;
        lonDest = 0;
        //TODO: helden laden
    }

    Tracker::~Tracker(){}

    void Tracker::exceeded(int warnlevel, int seconds, double lat, double lon) {

        qDebug() << "time exceeded! tracker" << warnlevel << seconds << lat << lon;
        //TODO: send information to server and push it to the helden
    }
    void Tracker::arrived() {
        qDebug("arrived..!");
        //TODO: send information to server and push it to the helden
    }
    void Tracker::start(de::heimweghelden::location::Route* route) {
        latStart = route->latStart;
        lonStart = route->lonStart;
        latDest = route->latEnd;
        lonDest = route->lonEnd;
        estimatedTime = route->estimatedDuration;
    }

} /* namespace tracking */
} /* namespace heimweghelden */
} /* namespace de */
